package com.vijos;

import java.util.ArrayList;
import java.util.List;

//巧妙填数,1~9构成三个三位数比例1:2:3
public class P3_2_1772 {

    public static void main(String[] args) {
        label1:
        for (int a = 123 ; a < 330; a++) {
            int b = a * 2;
            int c = a * 3;
            char[] aChars = String.valueOf(a).toCharArray();
            char[] bChars = String.valueOf(b).toCharArray();
            char[] cChars = String.valueOf(c).toCharArray();
            int[] flags = new int[10];
            for (int i = 0; i < aChars.length; i++) {
                int valueA = aChars[i] - '0';
                int valueB = bChars[i] - '0';
                int valueC = cChars[i] - '0';
                if (valueA == 0 || flags[valueA] == 1) {
                    continue label1;
                }
                flags[valueA] = 1;
                if (valueB == 0 || flags[valueB] == 1) {
                    continue label1;
                }
                flags[valueB] = 1;
                if (valueC == 0 || flags[valueC] == 1) {
                    continue label1;
                }
                flags[valueC] = 1;
            }
            System.out.println("a=" + a + ",b=" + b + ",c=" + c);
        }
    }
}
